﻿using System;

namespace TSharp.Core.Authentication.Facade
{
    /// <summary>
    /// 帐户异常信息
    /// <para>by tangjingbo at 2010/7/6 23:36</para>
    /// </summary>
    public class AccountException : Exception
    {
        #region ErrorType enum

        /// <summary>
        /// 帐号登录错误
        /// </summary>
        public enum ErrorType
        {
            /// <summary>
            /// 用户不存在
            /// </summary>
            NoUser,
            /// <summary>
            /// 帐号被禁用
            /// </summary>
            NoApproved,
            /// <summary>
            /// 帐号被锁定
            /// </summary>
            LockedOut,
            /// <summary>
            /// 密码无效
            /// </summary>
            ErrorPassWord,
            /// <summary>
            /// 未知
            /// </summary>
            UnKown
        }

        #endregion

        private readonly ErrorType _Type;

        /// <summary>
        /// 帐号异常
        /// <para>by tangjingbo at 2010/7/6 23:38</para>
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="type">The type.</param>
        public AccountException(string message, ErrorType type)
            : base(message)
        {
            _Type = type;
        }

        /// <summary>
        /// Gets the type.
        /// </summary>
        /// <value>The type.</value>
        public ErrorType Type
        {
            get { return _Type; }
        }

        private string GetErrorMessage(ErrorType type)
        {
            return "";
        }
    }
}